home *** CD-ROM | disk | FTP | other *** search
- Path: merle.acns.nwu.edu!judd
- From: judd@merle.acns.nwu.edu (Stephen Judd)
- Newsgroups: comp.sys.cbm
- Subject: Re: Commodore Arithmetic
- Date: 9 Feb 1996 06:15:39 GMT
- Organization: Northwestern University, Evanston IL
- Message-ID: <4feoqb$b1c@news.acns.nwu.edu>
- References: <96020719151143766@qcs.org>
- Reply-To: sjudd@nwu.edu (Stephen Judd)
- NNTP-Posting-Host: merle.acns.nwu.edu
-
- In article <96020719151143766@qcs.org>, Alan Jones <alan.jones@qcs.org> wrote:
- >If you do accounting type stuff with dollars and cents, using binary FP
- >with its limited precision and rounding can be anoying. If your
- >results are off one penny, all of your work will be suspect. Our 6502
- >family of CPUs also has decimal arithmetic. It can do decimal
- >arithmetic exactly, although you may have to program it yourself. I
- >think the Paperclip word Processor will do simple calculations with up
- >to 40 decimal digits of precision.
-
- Note that you can just as easily use integers for the calculations, and
- just divide by 100 before printing the result (e.g. in the case of dollars
- and cents). I think BCD is a waste, and completely useless to boot. :)
-
- By the way, I believe many of the old business machines (e.g. Burroughs)
- used BCD extensively (not to mention octal, e.g. a 6- or 9- bit byte :).
-
- >This is not intended to be a Commodore FP tutorial. It is reminder
- >that the C64/128 can be used for "heavy math", and there are no bugs
- >in the Commodore +, -, *, /, Floating Point arithmetic routines. It
- >uses 32 binary bit mantisa FP reals with proper rounding.
- >Simple examples can always be contrived to demonstrate a perceived FP
- >bug by computer illiterates(?).
-
- Just for fun, here is some "Heavy Math" that you can use your C64 for:
-
- x_n+1 = r * x_n * (1-x_n)
-
- Try iterating that function for 0<=x<=1 for various values of r between
- one and four (1<r<4), and see what happens ;). That is, fix r at some
- number between one and four. Then pick a starting point x_0 somewhere
- between zero and one. Then iterate the function, and see where x_n
- goes.
-
- evetS-
-
- >alan.jones@qcs.org
-